<template>
		<div style="width: 100%;height: 100%;">
		
		<mu-paper >
		    <mu-bottom-nav :value="bottomNav"  @change="handleChange" style="background-color:white;position: fixed;left: 0;bottom: 0;box-shadow: 0 -2px 3px rgba(200,200,200,0.2);">
		      <!--<mu-bottom-nav-item value="demoLaddingBills" to="/demoLaddingBills" title="授权单" icon="vpn_key"/>-->
		      <mu-bottom-nav-item value="demoSaleOrderList" to="/demoSaleOrderList" title="订单" icon="format_list_bulleted"/>
		      <mu-bottom-nav-item value="demoDataCenter" to="/demoDataCenter" title="数据分析" icon="trending_up"/>
		      <!--<mu-bottom-nav-item value="pictures" title="Pictures" icon="photo"/>-->
		    </mu-bottom-nav>
	    </mu-paper>
	    <router-view style="height: 100%;"></router-view>
	</div>
</template>
	

<script>
	export default {
  data () {
    return {
    	  bottomNav: 'demoSaleOrderList',
	      bottomNavColor: 'movies',
	      factoryInfo:{},
	      factoryId:''
    }
  },
  	mounted(){
	  	this.factoryId=this.$route.params.factoryId
	  	
	  	var paramData=this.$route.params.factoryId
	  	if(typeof(paramData)!="undefined"){
	  		localStorage.factoryId=this.$route.params.factoryId
	  		this.loginFacotry()
	  	}
		
   },
  methods: {
  	handleChange (val) {
	      this.bottomNav = val
	  },
    loginFacotry()
    {
    	let that=this;
    	console.info(localStorage.factoryId)
	    that.axios.post('/factoryUser/loginFacotry',{
	      			'factoryId':localStorage.factoryId,
	      			'imei':localStorage.userNumber
	    }).then(function(response){
//			that.factoryInfo
			localStorage.factoryInfo=JSON.stringify(response.data.data)
			localStorage.uid=JSON.stringify(response.data.data.UID)
			console.log(that.factoryInfo)
			that.$router.push({
	  		path:'/'+that.bottomNav
	  	})

	    }).catch(function(error){
	      	console.log(error)
	      	console.log('失败')
	    })
    }
  }
}
</script>

<style>
</style>